VelocityTrackerCompat
Helper for accessing features in VelocityTracker.
Types
Link copied to clipboard
Functions
Link copied to clipboard
open fun addMovement(@NonNull tracker: @NonNull VelocityTracker, @NonNull event: @NonNull MotionEvent)
Add a user's movement to the tracker.
Link copied to clipboard
Reset the velocity tracker back to its initial state.
Link copied to clipboard
Equivalent to invoking computeCurrentVelocity with a maximum velocity of Float.MAX_VALUE.
open fun computeCurrentVelocity(@NonNull tracker: @NonNull VelocityTracker, units: Int, maxVelocity: Float)
Compute the current velocity based on the points that have been collected.
Link copied to clipboard
Equivalent to calling getAxisVelocity for
axis
and the active pointer.open fun getAxisVelocity(@NonNull tracker: @NonNull VelocityTracker, axis: Int, pointerId: Int): Float
Retrieve the last computed velocity for a given motion axis.
Link copied to clipboard
Call getXVelocity.
Link copied to clipboard
Call getYVelocity.
Link copied to clipboard
Checks whether a given velocity-trackable MotionEvent axis is supported for velocity tracking by this VelocityTracker instance (refer to getAxisVelocity for a list of potentially velocity-trackable axes).
Link copied to clipboard
Return a VelocityTracker object back to be re-used by others.